import { ObjCreate } from "../common/ObjCreate";
import { GlobalStyle } from "../../../common/global/GlobalStyle";
import { GCheckBox } from "../../../../com/mui/controls/GCheckBox";
import { GTextFiled } from "../../../../com/mui/controls/GTextFiled";
//class LoveTaskRadioBtn
    
    export  class LoveTaskRadioBtn /* flash.display.Sprite */
    {
        constructor()
        {
            
            this.initUI();
            return;
        }

        public set selected(arg1: Boolean)
        {
            this._radioBtn.selected = arg1;
            return;
        }

        public get selected(): Boolean
        {
            return this._radioBtn.selected;
        }

        public get data(): Object
        {
            return this._data;
        }

        protected onRadioTxtClickHandler(arg1: Object /* flash.events.MouseEvent */): void
        {
            this._radioBtn.selected = !this._radioBtn.selected;
            dispatchEvent(new Object /* flash.events.Event */(flash.events.Event.CHANGE));
            return;
        }

        protected onSelectedChangeHandler(arg1: Object /* flash.events.Event */): void
        {
            dispatchEvent(arg1);
            return;
        }

        protected initUI(): void
        {
            this._radioBtn = ObjCreate.createCheckBox("", 0, 0, 200, 24, this);
            this._radioBtn.addEventListener(flash.events.Event.CHANGE, this.onSelectedChangeHandler);
            this._radioTxt = ObjCreate.createGTextField("", this._radioBtn.x + 20, this._radioBtn.y + 5, 200, 20, this);
            this._radioTxt.textColor = GlobalStyle.color1Uint;
            this._radioTxt.addEventListener(flash.events.MouseEvent.CLICK, this.onRadioTxtClickHandler);
            return;
        }

        public updateData(arg1: Object): void
        {
            this._data = arg1;
            return;
        }

        public dispose(): void
        {
            this._data = null;
            this._radioBtn.selected = false;
            this._radioTxt.toolTipData = null;
            return;
        }

        public /* override */ get width(): number
        {
            return 300;
        }

        public /* override */ get height(): number
        {
            return 30;
        }

        protected /* var */_radioBtn: GCheckBox;

        protected /* var */_radioTxt: GTextFiled;

        protected /* var */_data: Object;
    }
